package model;

import model.UserType;

import java.io.Serializable;
import java.time.LocalDateTime;

public class User implements Serializable {
    private String id;
    private String username;
    private String password;
    private UserType userType;
    private String phoneNumber;
    private LocalDateTime registrationTime;
    private boolean needResetPassword;

    public User(String id, String username, String password, UserType userType, String phoneNumber) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.userType = userType;
        this.phoneNumber = phoneNumber;
        this.registrationTime = LocalDateTime.now();
        this.needResetPassword = false;
    }

    public String getId() {
        return id;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public UserType getUserType() {
        return userType;
    }

    public void setUserType(UserType userType) {
        this.userType = userType;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public LocalDateTime getRegistrationTime() {
        return registrationTime;
    }

    public boolean isNeedResetPassword() {
        return needResetPassword;
    }

    public void setNeedResetPassword(boolean needResetPassword) {
        this.needResetPassword = needResetPassword;
    }

    @Override
    public String toString() {
        return "用户ID：" + id +
               "，用户名：" + username +
               "，用户类型：" + userType +
               "，手机号：" + phoneNumber +
               "，注册时间：" + registrationTime;
    }
}
